﻿using System;
using TestingConcurrencyBenchmark.Problems.DiningPhilosophers.DiningPhilosophersSolutions;

namespace TestingConcurrencyBenchmark.ProblemFactories
{
    internal class DiningPhilosophersFactory : IProblemFactory<AbstractDiningPhilosophers>
    {
        private readonly int _nbPhilosophers;

        public DiningPhilosophersFactory(int nbPhilosophers)
        {
            _nbPhilosophers = nbPhilosophers;
        }

        #region IProblemFactory<AbstractDiningPhilosophers> Members

        public AbstractDiningPhilosophers GetSolution()
        {
            return new DiningPhilosophersWithLeftHandedRightHanded(_nbPhilosophers);
        }

        public AbstractDiningPhilosophers GetSolutionWithDeadlock()
        {
            return new DiningPhilosophersWithDeadLock(_nbPhilosophers);
        }

        public AbstractDiningPhilosophers GetSolutionWithRaceCondition()
        {
            throw new NotImplementedException();
        }

        public AbstractDiningPhilosophers GetSolutionWithDatarace()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}